package van.planifolia.demo02;

/**
 * Created by Intellij IDEA<br>
 *
 * @author Planifolia.Van
 * @version 1.0
 * @date 2022/10/25 16:36
 */
public class Message<T,E> {
    /**
     * messageContext 消息正文
     * messageCode 消息码
     */
    private final T messageContext;
    private final E messageCode;

    public Message(T messageContext, E messageCode) {
        this.messageContext = messageContext;
        this.messageCode = messageCode;
    }

    /**
     * 消息打印方法
     */
    public void print(){
        System.out.println("消息编号为" + messageCode + ",消息正文为" + messageContext);
    }

    @Override
    public String toString() {
        return "Message{" +
                "messageContext=" + messageContext +
                ", messageCode=" + messageCode +
                '}';
    }
}
